// Valley of Trials
//
// level 1-5 Pscript file with quests V0.1 starting as Orc Warrior
// There will lots of comments in this one!!
Par
{
    $prio = 1;
    $MinLevel = $MyLevel-4;
    $MaxLevel = $MyLevel+1;
  Loot
   {
   }
  Rest
    {
        $Prio = 0;
    }
  Defend // Attack back attackers
    {
        $Prio = 0;
    }
  Danger
    {
      $Prio = 1;
      $Distance = 20;
    }

  Vendor
    {
	        $NPC = "Huklah"; 
      $MinDurability = 0.2; 
      $MinFreeBagSlots = 2; 
      $Protected = ["hearth", "potion", "bag"]; 
      $SellGray = true; 
      $SellWhite = true; 
      $SellGreen = false;
      $Location = [ -582.02, -4109.66, 43.5]; 
      $BlacklistTime = 3 * 60; 
    }
}
Par
$prio = 2;
{
When
 {
   $cond = $MyLevel >= 1 && $MyLevel <= 5;
   seq
	{
	  $Name = "Your Place In The World";
	  $ID = 4641;
	QuestPickup
	  {
		$NPC = "Kaltunk";
		$Location = [-607.63, -4251.35, 38.96];
	  }
	QuestGoal
      {
	    par
		  {
		  }
	  }  
	QuestHandin
	  {
	    $NPC = "Gornek";
		$Location = [-600.31, -4186.27, 41.09];
	  }
    }	
 }
When
 {
  $cond = $MyLevel >= 1 && $MyLevel <= 5;
  seq
	{
	  $Name = "Cutting Teeth";
	  $ID = 788;
	QuestPickup
	  {
		$NPC = "Gornek";
		$Location = [-600.31, -4186.27, 41.09];
	  }
	QuestGoal
        {
            Par
            {
                Until
                {
                    $cond = $var1.grinder.KillCount{"Mottled Boar"} >= 10;
                    var1:Par
                    {
                        grinder : Pull
                        {
                            $Prio = 3;
                            $Names = ["Mottled Boar"];
							$Factions = [189];
                        }
                        Hotspots
                        {
                            $Prio = 5;
                            $Locations = [[ -755, -4180, 30.35], [ -751.279, -4255.5, 43.5458], [ -748, -4324, 41.869], [ -733, -4246, 38.406], [ -727, -4227, 38.475], [ -719, -4147, 30.194], [ -710, -4279, 41.833], [ -693, -4272, 38.32], [ -684, -4252, 38.2], [ -677, -4354, 44.728], [ -669, -4266, 38.223], [ -616, -4392, 44.087], [ -613, -4446, 45.662], [ -565, -4400, 44.437], [ -552, -4304, 37.233], [ -550, -4349, 42.728], [ -544, -4413, 42.213], [ -514, -4385, 48.351], [ -511, -4414, 53], [ -511, -4340, 38.41], [ -510, -4300, 39.907], [ -487, -4144, 54.996], [ -486, -4460, 50.845], [ -482, -4221, 49.788], [ -480, -4183, 51.661], [ -479, -4345, 40.996], [ -455, -4249, 49.539], [ -455, -4214, 50.063], [ -450, -4105, 52.196], [ -447, -4180, 46.309], [ -444, -4137, 51.627], [ -431, -4065, 50.47], [ -426, -4087, 49.409], [ -420, -4377, 41.648], [ -418, -4415, 45.33], [ -415, -4277, 43.401], [ -409, -4322, 43.289], [ -395, -4132, 50.84], [ -393, -4221, 56.312], [ -389, -4345, 41.765], [ -373, -4118, 50.425], [ -348, -4295, 56.075], [ -348, -4212, 60.171], [ -345, -4386, 50.125], [ -312, -4215, 52.3], [ -290, -4319, 61.007], [ -185, -4238, 57.433]];
                        }
                    }
                }
            }
        }
	QuestHandin
	  {
	    $NPC = "Gornek";
		$Location = [-600.31, -4186.27, 41.09];
	  }
    }	
 }
// You should be Level 2 by now... This is for the warrior. 
When
 {
  $cond = $MyLevel >= 2 && $MyLevel <= 5;
  seq
	{
	  $Name = "Simple Parchment";
	  $ID = 12635;
	QuestPickup
	  {
		$NPC = "Gornek";
		$Location = [-600.31, -4186.27, 41.09];
	  }
	QuestGoal
      {
	    par
		  {
		  }
	  }  
	QuestHandin
	  {
	    $NPC = "Frang";
		$Location = [-639.09, -4230.37, 38.13];
	  }
    }	
 }
// now lets get another one
When
 {
  $cond = $MyLevel >= 1 && $MyLevel <= 8 && QuestStatus("788") == "completed";
  Seq
    {
      $Name = "Sting of the Scorpid";
      $ID = 789;
    QuestPickup
       {
         $NPC = "Gornek";
         $Location = [-600.06,-4177.91, 41.2442];
        }
    QuestGoal
        {
            Par
               {
                 Until
                    {
                      $cond = $ItemCount{"Scorpid Worker Tail"} >= 10;
                        Par
                         {
                            Pull
                              {
                                    $Prio = 4;
                                    $Names = ["Scorpid Worker"];
                                }
                                Hotspots
                                {
                                    $Prio = 5;
                                    $Locations = [[ -782, -4247, 51.784], [ -753, -4355, 52], [ -738, -4160, 30.065], [ -737, -4197, 30.006], [ -713, -4354, 49.8], [ -709, -4225, 41.287], [ -683, -4321, 47.196], [ -682, -4114, 33.929], [ -675, -4356, 44.505], [ -599, -4119, 73.835], [ -591, -4084, 74.274], [ -589, -4139, 73.737], [ -573, -4114, 72.943], [ -568, -4090, 70.847], [ -546, -4122, 66.175], [ -530, -4112, 64.001], [ -517, -4177, 77.382], [ -511, -4109, 57.733], [ -505, -4345, 38.237], [ -475, -4139, 50.499], [ -469, -4113, 51.4], [ -450, -4454, 49.296], [ -450, -4175, 46.266], [ -449, -4485, 53.506], [ -443, -4285, 42.275], [ -437, -4103, 50.631], [ -421, -4155, 51.552], [ -417, -4295, 42.231], [ -416, -4052, 52.474], [ -410, -4819, 37.341], [ -400, -4448, 51.566], [ -398, -4347, 41.029], [ -396, -4167, 51.717], [ -391, -4250, 52.427], [ -369, -4056, 51.025], [ -367, -4454, 51.418], [ -356, -4431, 50.694], [ -354, -4079, 52.049], [ -352, -4451, 53.422], [ -329, -4420, 54.131], [ -320, -4139, 53.029], [ -314, -4411, 56.943], [ -304, -4142, 54.415], [ -297, -4270, 60.086], [ -287, -4357, 54.141], [ -286, -4287, 60.006], [ -282, -4214, 54.931], [ -278, -4433, 59.202], [ -264, -4311, 54.945], [ -247, -4255, 61.441], [ -247, -4217, 60.744], [ -245, -4360, 63.545], [ -242, -4421, 62.883], [ -210, -4318, 64.389], [ -210, -4175, 66.461], [ -186, -4246, 57.446], [ -32, -4616, 45.257], [ 483.11, -4467, 47.998], [ 667.382, -4608, -1], [ 1138.45, -3966, 14.152]];
                                }
                                Pull
                                {
                                    $Prio = 4;
                                    $Names = ["Sarkoth"];
                                }
                                Hotspots
                                {
                                    $Prio = 5;
                                    $Locations = [[ -585, -4118, 74.471]];
                                }
                            }
                        }
                    }
                }
                QuestHandin
                {
                    $NPC = "Gornek";
                    $Location = [-600.06,-4177.91, 41.2442];
                }
            }
        }
// already level 3? Nice. Lets move on 
When
        {
            $cond = $MyLevel >= 1 && $MyLevel <= 8 && QuestStatus("788") == "completed";
            Seq
            {
                $Name = "Galgar's Cactus Apple Surprise";
                $ID = 4402;
                QuestPickup
                {
                    $NPC = "Galgar";
                    $Location = [-565,-4224, 41.498];
                }
                QuestGoal
                {
                    Par
                    {
                        Until
                        {
                            $cond = $ItemCount{"Cactus Apple"} >= 10;
                            Par
                            {
                                Harvest { $Prio = 4; $Names = ["Cactus Apple"]; }
                                Hotspots
                                {
                                    $Prio = 5;
                                    $Locations = [[ -771, -4209, 45.665], [ -746, -4277, 43.755], [ -695, -4359, 54.404], [ -651, -4428, 60.122], [ -646, -4744, 34.09], [ -636, -4743, 32.776], [ -602, -4076, 75.888], [ -592, -4074, 74.409], [ -569, -4391, 47.009], [ -550, -4289, 37.326], [ -518, -4187, 77.106], [ -490, -4469, 53.9901], [ -490, -4287, 42.742], [ -490, -4090, 64.581], [ -488, -4298, 43.198], [ -480, -4322, 43.722], [ -446, -4123, 51.0978], [ -424, -4175, 50.886], [ -423, -4171, 51.629], [ -421, -4180, 51.1476], [ -415, -4403, 45.726], [ -414, -4258, 49.163], [ -414, -4057, 52.207], [ -413, -4067, 50.788], [ -406, -4461, 52.001], [ -405, -4396, 43.535], [ -404, -4264, 49.381], [ -402, -4279, 48.208], [ -365, -4334, 55.248], [ -326, -4395, 58.3666], [ -317, -4106, 53.976], [ -316, -4444, 58.426], [ -298, -4332, 57.2075], [ -279, -4942, 24.829], [ -261, -4211, 58.747], [ -182, -4184, 81.512], [ 275.475, -4778, 11.82], [ 1215.01, -4376, 26.672]];
                                }
                            }
                        }
                    }
                }
                QuestHandin
                {
                    $NPC = "Galgar";
                    $Location = [-565,-4224, 41.498];
                }
            }
        }
When
        {
            $cond = $MyLevel >= 3 && $MyLevel <= 10; 
					
			
            Seq
            {
 
				$Name = "Sarkoth";
                $ID = 790;
                QuestPickup
                {
                    $NPC = "Hana'zua";
                    $Location = [-398.723,-4109.47, 50.1873];
                }
                QuestGoal
                {
                    Par
                    {
                        Until
                        {
                            $cond = $ItemCount{"Sarkoth's Mangled Claw"} >= 1;
                            Par
                            {
                                Pull
                                {
								    $cond = $FreeBagSlots >= 1;// Im trying to get free bags for this quest. Else its just sits there	
                                    $Prio = 4;
                                    $Names = ["Sarkoth"];
                                }
                                Hotspots
                                {
                                    $Prio = 5;
                                    $Locations = [[ -585, -4118, 74.471]];
                                }
                            }
                        }
                    }
                }
                QuestHandin
                {
                    $NPC = "Hana'zua";
                    $Location = [-398.723,-4109.47, 50.1873];
                }
            }
        }
When
        {
            $cond = $MyLevel >= 3 && $MyLevel <= 10 && QuestStatus("790") == "completed";
            Seq
            {
                $Name = "Sarkoth";
                $ID = 804;
                QuestPickup
                {
                    $NPC = "Hana'zua";
                    $Location = [-398.723,-4109.47, 50.1873];
                }
                QuestGoal
                {
                    Par
                    {
                    }
                }
                QuestHandin
                {
                    $NPC = "Gornek";
                    $Location = [-600.06,-4177.91, 41.2442];
                }
            }
        }
When
        {
            $cond = $MyLevel >= 2 && $MyLevel <= 9;
            Seq
            {
                $Name = "Vile Familiars";
                $ID = 792;
                QuestPickup
                {
                    $NPC = "Zureetha Fargaze";
                    $Location = [-629.118,-4226.6, 38.1416];
                }
                QuestGoal
                {
                    Par
                    {
                        Until
                        {
                            $cond = $var1.grinder.KillCount{"Vile Familiar"} >= 12;
                            var1:Par
                            {
                                grinder : Pull
                                {
                                    $Prio = 4;
                                    $Names = ["Vile Familiar"];
                                }
                                Hotspots
                                {
                                    $Prio = 5;
                                    $Locations = [[ -404, -4454, 51.938], [ -323, -4375, 53.699], [ -282, -4387, 58.158], [ -261, -4322, 56.534], [ -254, -4282, 60.91], [ -234, -4355, 63.998], [ -216, -4384, 63.453], [ -214, -4335, 65.32], [ -209, -4283, 65.794], [ -195, -4389, 64.622], [ -189, -4358, 67.427], [ -167, -4404, 77.163], [ -158, -4277, 78.98], [ -140, -4279, 63.789], [ -132, -4356, 67.16], [ -128, -4318, 66.093], [ -116, -4217, 54.394], [ -103, -4302, 61.603], [ -86, -4287, 61.34], [ -80, -4236, 53.51], [ -80, -4209, 50.154], [ -77, -4265, 52.407], [ -48, -4313, 68.795], [ -46, -4332, 68.643], [ -44, -4225, 63.537], [ -20, -4257, 66.814]];
                                }
                            }
                        }
                    }
                }
                QuestHandin
                {
                    $NPC = "Zureetha Fargaze";
                    $Location = [-629.118,-4226.6, 38.1416];
                }
            }
        }
When
{
    $prio = 3;
	$cond = $MyLevel >= 3 && $MyLevel <= 10 && QuestStatus("792") == "completed";
    Seq
    {
        $Name = "Burning Blade Medallion";
        $ID = 794;
        QuestPickup
        {
            $NPC = "Zureetha Fargaze";
            $Location = [-629.118,-4226.6, 38.1416];
        }
        QuestGoal
        {
            Par
            {
                Until
                {
                    $cond = $ItemCount{"Burning Blade Medallion"} >= 1;
                    Par
                    {
                        Pull
                        {
                            $Prio = 3;
                            $Names = ["Yarrog Baneshadow"];
                        }
						Pull
                        {
                            $Prio = 5;
                            $Names = ["Vile Famillar", "Felstalker"];
                        }
                        Hotspots
                        {
                            $Prio = 4;
                            $Order = Order;
                            $Locations = [[ -198.3, -4355.2, 66.7],[ -129.9, -4348.9, 66.9],[ -53.0, -4300.5, 70.3],[ -31.8, -4233.6, 67.3],[ -64.8, -4219.4, 62.1]];    
                        }
                    }
                }
            }
        }
        QuestHandin
        {
            $NPC = "Zureetha Fargaze";
            $Location = [-629.118,-4226.6, 38.1416];
        }
    }
}
// Now we should be level 5. Lets move ahead to sinjin village. Last quest in start area.
When
        {
            $cond = $MyLevel >= 4 && $MyLevel <= 10 && QuestStatus("794") == "completed";
            Seq
            {
                $Name = "Report to Sen'jin Village";
                $ID = 805;
                QuestPickup
                {
                    $NPC = "Zureetha Fargaze";
                    $Location = [-629.118,-4226.6, 38.1416];
                }
                QuestGoal
                {
                    Par
                    {
                    }
                }
                QuestHandin
                {
                    $NPC = "Master Gadrin";
                    $Location = [-823.191,-4921.98, 19.4516];
                }
            }
        }
// now we are in danger area and Im moving to a new file. I will call it Sinjin village
}

